Repository navigation
telemetry: LiveKit product statistics for agents and plugins - #8768
Merged
Merged
Conversation
Runner::detect derives production, development, ci or unknown from the launching command, the platform and the CI and LK_HOSTED_AGENTS variables. The launcher records the parsed command; a job process receives its worker's in the IPC hello. The product statistics opt-out (LIVEKIT_PRODUCT_STATS=0, DO_NOT_TRACK=1) is read once beside it.
abi::productstats declares the resource (lk.productstats.*), the provider, job, crash, stall and drop instruments, and the plugin host function. The telemetry codegen refuses a product statistics declaration with content, free text or an lk.pii.* key.
lk_agents_net::export::productstats aggregates the shared recorder's measurements with delta temporality and posts them once a minute, gzipped OTLP/HTTP protobuf, to /productstats/agents/v0/metrics on the Cloud host. A non-Cloud URL sends nothing; a window without a credential is held, one at a time; drops are counted and exported next. Its destination and failures are separate from the customer observability exporter.
LLM and TTS requests at their trace's end (requests, retries, failures by class, TTFT/TTFB, duration), STT where its attempts are retried or given up, realtime sessions' retries, reconnects and failures, fallbacks when a chain launches on another entry, end-of-turn, VAD, STT and realtime latencies from their metrics records, event-loop stalls by frame names, job starts and outcomes, and job processes that died. Servers and live jobs configure the export's Cloud credential.
Plugin.register_plugin reports each plugin, and telemetry installation passes the Python version. Regenerated bindings, stubs and registry.
Contributor
There was a problem hiding this comment.
Devin Review found 1 potential issue.
6 flags not posted on this PR by your GitHub settings β view them in Devin Review. (Configure)
Comment on lines
+41
to
+46
| pub fn cloud(livekit_url: &str, api_key: &str, api_secret: &str) -> Option<Self> { | ||
| if api_key.is_empty() || api_secret.is_empty() { | ||
| return None; | ||
| } | ||
| let base_url = crate::strings::observability_url(livekit_url, None)?; | ||
| Some(Destination { base_url, api_key: api_key.into(), api_secret: api_secret.into() }) |
Contributor
There was a problem hiding this comment.
π₯ Project bearer sent outside LiveKit Cloud
A compromised worker endpoint can steer Destination::cloud through the assigned room URL. The Cloud hostname check and HTTP client interpret URL separators differently. The resulting request can disclose a project observability-write bearer to a non-LiveKit host.
Was this helpful? React with π or π to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.